<?php
 // XOR encrypt/descript
 function xor_encrypt($plain,$key) {
     $seed=str_repeat($key,strlen($plain));
     return bin2hex($plain^$seed);
 }
 function xor_decrypt($enc,$key) {
     $seed=str_repeat($key,strlen($enc));
     return pack("H*",$enc)^$seed;
}
// 测试代码
$key=  date('Y-m-d');
$enc=xor_encrypt("http://blog.csdn.net/froole/archive/2009/05/13/4176111.aspx",$key);
echo "enc:[".$enc."]\n";
echo "Org:[".xor_decrypt($enc,$key)."]\n";